package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.CanteenMapper;
import com.ruoyi.jypc.domain.Canteen;
import com.ruoyi.jypc.service.ICanteenService;

/**
 * 餐厅Service业务层处理
 * 
 * @author wwq
 * @date 2022-10-27
 */
@Service
public class CanteenServiceImpl implements ICanteenService 
{
    @Autowired
    private CanteenMapper canteenMapper;

    /**
     * 查询餐厅
     * 
     * @param canteenid 餐厅主键
     * @return 餐厅
     */
    @Override
    public Canteen selectCanteenByCanteenid(Long canteenid)
    {
        return canteenMapper.selectCanteenByCanteenid(canteenid);
    }

    /**
     * 查询餐厅列表
     * 
     * @param canteen 餐厅
     * @return 餐厅
     */
    @Override
    public List<Canteen> selectCanteenList(Canteen canteen)
    {
        return canteenMapper.selectCanteenList(canteen);
    }
    
    /**
     * 查询餐厅列表
     * 
     * @return 餐厅集合
     */
    @Override
    public List<Canteen> selectCanteenListAll(){
    	return canteenMapper.selectCanteenListAll();
    }

    /**
     * 新增餐厅
     * 
     * @param canteen 餐厅
     * @return 结果
     */
    @Override
    public int insertCanteen(Canteen canteen)
    {
        canteen.setCreateTime(DateUtils.getNowDate());
        return canteenMapper.insertCanteen(canteen);
    }

    /**
     * 修改餐厅
     * 
     * @param canteen 餐厅
     * @return 结果
     */
    @Override
    public int updateCanteen(Canteen canteen)
    {
        canteen.setUpdateTime(DateUtils.getNowDate());
        return canteenMapper.updateCanteen(canteen);
    }

    /**
     * 批量删除餐厅
     * 
     * @param canteenids 需要删除的餐厅主键
     * @return 结果
     */
    @Override
    public int deleteCanteenByCanteenids(Long[] canteenids)
    {
        return canteenMapper.deleteCanteenByCanteenids(canteenids);
    }

    /**
     * 删除餐厅信息
     * 
     * @param canteenid 餐厅主键
     * @return 结果
     */
    @Override
    public int deleteCanteenByCanteenid(Long canteenid)
    {
        return canteenMapper.deleteCanteenByCanteenid(canteenid);
    }
}
